

/**
 * 
 *
 * Copyright (c) 2012-2013 JLLT Corp. 2012-2013,All Rights Reserved.
 * This software is published under the 金麟龙腾商贸有限公司.
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file. 
 *
 * @File name:  MatchUtils.java   非空校验工具类。 
 * @Create on:  2012-07-18 22:23:111
 * @Author      :  高宇舟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */

package com.boho.ecp.util;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class MatchUtils {
	
	public static boolean isEmpty(Object obj) {
		return obj == null;
	}
	
	public static boolean isEmpty(Map<?, ?> map) {
		return (map == null || map.size() == 0);
	}
	
	public static boolean isEmpty(String str) {
		return (str == null || "".equals(str) || str.trim().length() == 0);
	}
	
	public static boolean isEmpty(Arrays[] arr) {
		return (arr == null || arr.length == 0);
	}
	
	public static boolean isEmpty(List<?> lis) {
		return (lis == null || lis.size() == 0);
	}
	
	public static boolean isEmpty(Iterator<?> ita) {
		return (ita == null || !ita.hasNext());
	}
	
	public static boolean isEmpty(StringBuffer sbf) {
		return (sbf == null || sbf.length() == 0);
	}
	
}